package ca.on.eho.qa.applogic0;

import ca.on.eho.qa.model.User;
import ca.on.eho.qa.applogic.UserHelper;

public class UserHelper0 implements UserHelper {
	
	private User user;
	
	@Override
	public void loginAs (User user) {
/*		
 		if (user.getPassword().equals("wrong")) {
			return;
		}
*/
			this.user = user;
		}
	
	@Override
	public void logout() {
		this.user = null;
	}
	
	@Override
	public boolean isLoggedIn() {
		return user != null;
	}
	
	@Override
	public boolean isLoggedInAs(User user) {
		return isLoggedIn(); // && this.user.getLogin().equals(user.getLogin());
	}

	@Override
	public boolean isNotLoggedIn() {
		return user == null;
	}
	
}
